<?php $dias = $this->requestAction("calendarios/diasDoAnuncio/$id_anuncios");?>

<table class="calendario">
	<tr>
		<th><?php echo __('Dom');?></th>
		<th><?php echo __('Seg');?></th>
		<th><?php echo __('Ter');?></th>
		<th><?php echo __('Qua');?></th>
		<th><?php echo __('Qui');?></th>
		<th><?php echo __('Sex');?></th>
		<th><?php echo __('Sáb');?></th>
	</tr>
	<?php for($i=8;$i<=45;){?>
	<tr>
		<?php for($j=0;$j<7;$j++,$i++){?>
			<?php if($i%31 == 0) $i+=1;?>
			<?php if(!empty($dias) && in_array($i, $dias)) $class = " class='ocupado' ";else $class = "";?>
			<td <?php echo $class;?>>
				<span><?php echo $i%31;?></span>
				<?php if($i>31){?>
				<span style="display: none;">07</span>
				<?php }else{?>
				<span style="display: none;">06</span>
				<?php }?>
			</td>
		<?php }?>
	</tr>
	<?php }?>

</table>